# for i in range(1, 10):
#     print()
#     for j in range(1, i + 1):
#         print("%d*%d=%d" % (i, j, i * j), end=" ")


# num = int(input("输入整数："))
#
# if num % 2 == 0:
#     print(num, '是偶数')
# else:
#     print(num, '是奇数')

# dog_age = float(input('请输入狗的年龄：'))
# person_age = 0
#
# if dog_age > 0:
#     if dog_age <= 2:
#         person_age = dog_age * 10.5
#     else:
#         person_age = 2 * 10.5
#         person_age += (dog_age - 2) * 4
#     print(dog_age, '岁的狗年纪相当于', person_age, '岁的人')
# else:
#     print('请输入一个合法的年龄')

#获取小明的成绩
# score = float(input('请输入期末考试成功：'))
#
# if score == 100:
#     print('奖励一辆宝马!')
# elif score >= 80:
#     print('奖励一部苹果手机')
# elif score >= 60:
#     print('奖励一本书')
# else:
#     print('奖励操场跑50圈')

# name = '许可宁'
#
# print(f"欢迎 {name} 光临")
# print('欢迎 '+name+' 光临')
# print('欢迎 %s 光临 ' %name)
# print('欢迎', name, '光临')
# print(type(name))

# # 100 以内奇数求和
# i = 0
# sum = 0
# while i < 100:
#     i += 1
#     if i%2 !=0:
#         sum = sum + i
#
# print(sum)

# # 获取100以内的奇数
# i= 1
# while i < 100:
#     print(i)
#     i += 2

# # 获取100以内所有7的倍数的和,以及个数
# i= 7
# result = 0
# count = 0
# while i < 100:
#     count += 1
#     result += i
#     i += 7
# print(result,count)

# 水仙花
# i = 100
# while i < 1000:
#     # i 的百位数
#     a = i // 100
#     # i 的十位数
#     b = i // 10 % 10
#     # i 的个位数
#     c = i % 10
#     # print(i, a, b, c)
#     if a**3 + b**3 +c**3 == i:
#         print(i)
#     i += 1

# 质数
# # 获取用户输入的任意数，判断是否是质数
# num = int(input('输入一个任意大于1的整数：'))
# # 判断num是否是质数，只能除1和它自身，不能被其他自然数整除的数就是质数
# # 获取到所有的可能被整除num的整数
# i = 2
# # 创建一个变量，用来记录num是否是质数，默认num是质数
# flag = True
# while i < num:
#     # 判断num 能否被i整数
#     # 如果num 能被i整数，则说明num一定不是质数
#     if num % i == 0 :
#         # 一旦进入判断，则证明num不是质数，则需要将flag修改为false
#         flag = False
#     i += 1
# if flag:
#     print(num, '是质数')
# else:
#     print(num, '不是质数')

# 99乘法表
# i = 1
#
# while i < 10:
#     # print(i)
#     j = 1
#     while j < i + 1:
#         print("%d*%d=%d" % (j, i, i * j), end=" ")
#         j += 1
#     print()
#     i += 1

# i = 0
#
# while i < 9:
#     i += 1
#     j = 0
#     while j < i :
#         j += 1
#         print(f"{j}*{i}={i*j}" , end=" ")
#
#     print()

# break:立即退出循环语句
# continue: 跳出当前循环语句，继续执行下一次循环，对最近的循环起作用
# i = 0
#
# while i < 5:
#     if i == 3:
#         break
#     print(i)
#     i += 1
# else:
#     print('循环结束')

# i = 0
#
# while i < 5:
#     i += 1
#     if i == 3:
#         continue
#     print(i)
# else:
#     print('循环结束')

# 质数代码优化
# from time import *
# begin = time()
#
# i = 2
# while i <= 100000:
#     flag = True
#     j = 2
#     while j <= i ** 0.5:
#         if i % j == 0:
#             flag = False
#             break
#         j += 1
#     if flag:
#         print(i)
#     i += 1
# end = time()
# print("程序执行花费了:", end - begin, "秒")

# r = range(5)
# r = range(0,10)
# print(r)
#
# print(list(r))

# for i in range(10):
#     print(i)

# d = {'name':'sunwukong','age':'21'}
# print(d)

# for k in d.keys():
#     print(k, d[k])

# for v in d.values():
#     print(v)

# for k,v in d.items():
#     print(d.items())
#     print(k, '=', v)

# import json
# import tablib
#
# with open('data.json', 'w', encoding='utf-8') as f:
#     data = json.load(f)
#     print(data)








